<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>OBManager Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
	<header>
		<div class="container" class="hide-in-xcode">
			
			<h1 id="library-title">
				<a href="../index.html">OBMessenger </a>
			</h1>

			<p id="developer-home">
				<a href="../index.html">On-Bright</a>
			</p>
			
		</div>
	</header>

	<aside>
		<div class="container">
			<nav>
				<ul id="header-buttons" role="toolbar">
					<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>

					<li id="on-this-page" role="navigation">
						<label>
							On This Page

							<div class="chevron">
								<div class="chevy chevron-left"></div>
								<div class="chevy chevron-right"></div>
							</div>

							<select id="jump-to">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	

	
	
	<option value="tasks">Tasks</option>
	
	

	
	
	<optgroup label="Properties">
		
		<option value="//api/name/autoLoadLocalData">autoLoadLocalData</option>
		
		<option value="//api/name/cacheDataSuccess">cacheDataSuccess</option>
		
		<option value="//api/name/currentUsername">currentUsername</option>
		
		<option value="//api/name/currentWeight">currentWeight</option>
		
		<option value="//api/name/delegate">delegate</option>
		
		<option value="//api/name/deviceTypeCount">deviceTypeCount</option>
		
		<option value="//api/name/enableLanData">enableLanData</option>
		
		<option value="//api/name/isServerMode">isServerMode</option>
		
		<option value="//api/name/lanControllable">lanControllable</option>
		
		<option value="//api/name/serverReachable">serverReachable</option>
		
		<option value="//api/name/shareModel">shareModel</option>
		
		<option value="//api/name/shareNetwork">shareNetwork</option>
		
		<option value="//api/name/shareServer">shareServer</option>
		
	</optgroup>
	

	
	<optgroup label="Class Methods">
		
		<option value="//api/name/currentViewController">+ currentViewController</option>
		
		<option value="//api/name/model">+ model</option>
		
		<option value="//api/name/network">+ network</option>
		
		<option value="//api/name/server">+ server</option>
		
		<option value="//api/name/versionCompare:">+ versionCompare:</option>
		
	</optgroup>
	

	
	<optgroup label="Instance Methods">
		
		<option value="//api/name/canLoginFromCache">- canLoginFromCache</option>
		
		<option value="//api/name/compareModelDataUpdated">- compareModelDataUpdated</option>
		
		<option value="//api/name/loadEntityData:">- loadEntityData:</option>
		
		<option value="//api/name/loadLocalData:forBox:">- loadLocalData:forBox:</option>
		
		<option value="//api/name/localDataIsReadyFor:withType:">- localDataIsReadyFor:withType:</option>
		
		<option value="//api/name/loginUser:andPw:">- loginUser:andPw:</option>
		
		<option value="//api/name/logout">- logout</option>
		
		<option value="//api/name/reloadDeviceTypeCount">- reloadDeviceTypeCount</option>
		
	</optgroup>
	
	
</select>
						</label>
					</li>
				</ul>
			</nav>
		</div>
	</aside>

	<article>
		<div id="overview_contents" class="container">
			<div id="content">
				<main role="main">
					<h1 class="title">OBManager Class Reference</h1>

					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<th>Inherits from</th>
	<td>NSObject</td>
</tr><tr>
	<th>Declared in</th>
	<td>OBManager.h</td>
</tr>
						</tbody></table></div>
					

                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>Main Singleton manager controlling whole OBMessenger functions and delegates</p>

<h2>Features:</h2>

<ul>
<li>Bridge of outside View-Controllers and inside Modules, included <a href="../Classes/OBModel.html">OBModel</a>, <a href="../Classes/OBNetwork.html">OBNetwork</a>, <a href="../Classes/OBServer.html">OBServer</a> and <a href="../Classes/OBBox.html">OBBox</a>.</li>
<li>The manager will auto initial modules and deal with response data from network-monitoring, <a href="#//api/name/server">server</a> or local OBox communicating to insert, delete or update <a href="#//api/name/model">model</a> entities.</li>
<li>Built-in <a href="#//api/name/delegate">delegate</a> forwarder, without setting <a href="#//api/name/delegate">delegate</a>, modules can report to current view-controller which conforms protocol and responses to selector.</li>
</ul>

					</div>
					
					

					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						

						
						

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/versionCompare:" title="versionCompare:"></a>
	<h3 class="method-title"><code><a href="#//api/name/versionCompare:">+&nbsp;versionCompare:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Develop Helper: System version compare</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>+ (NSComparisonResult)versionCompare:(nonnull NSString *)<em>versionStr</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>versionStr</code></th>
						<td><p>compare version string</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>NSComparisonResult with current version and versionStr</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/currentViewController" title="currentViewController"></a>
	<h3 class="method-title"><code><a href="#//api/name/currentViewController">+&nbsp;currentViewController</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Develop Helper: Get current view controller</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>+ (nullable UIViewController *)currentViewController</code></div>

		    
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>view-controller showing</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/delegate" title="delegate"></a>
	<h3 class="method-title"><code><a href="#//api/name/delegate">&nbsp;&nbsp;delegate</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Advanced: Set this delegate manual for fail-safe delegate interceptor</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, weak) _Nullable id delegate</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>OBManager will auto forward delegate to current view-controller which conforms to protocol
Make sure set for fail-safe interceptor and global receive delegate report</p>

<pre><code>@code
In AppDelegate init Manager as
[[OBManager sharedOBManager] setDelegate:self]
Or set to root-controller
like TabbarController or top navigationController
@endcode
</code></pre>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/model" title="model"></a>
	<h3 class="method-title"><code><a href="#//api/name/model">+&nbsp;model</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Get <a href="../Classes/OBModel.html">OBModel</a> singleton object</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>+ (nullable OBModel *)model</code></div>

		    
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p><a href="#//api/name/shareModel">shareModel</a></p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/shareModel" title="shareModel"></a>
	<h3 class="method-title"><code><a href="#//api/name/shareModel">&nbsp;&nbsp;shareModel</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p><a href="../Classes/OBModel.html">OBModel</a> object</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, weak, readonly) OBModel *shareModel</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/network" title="network"></a>
	<h3 class="method-title"><code><a href="#//api/name/network">+&nbsp;network</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Get <a href="../Classes/OBNetwork.html">OBNetwork</a> singleton object</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>+ (nullable OBNetwork *)network</code></div>

		    
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p><a href="#//api/name/shareNetwork">shareNetwork</a></p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/shareNetwork" title="shareNetwork"></a>
	<h3 class="method-title"><code><a href="#//api/name/shareNetwork">&nbsp;&nbsp;shareNetwork</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p><a href="../Classes/OBNetwork.html">OBNetwork</a> object</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, weak, readonly) OBNetwork *shareNetwork</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/server" title="server"></a>
	<h3 class="method-title"><code><a href="#//api/name/server">+&nbsp;server</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Get <a href="../Classes/OBServer.html">OBServer</a> singleton object</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>+ (nullable OBServer *)server</code></div>

		    
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>shareServer]</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/shareServer" title="shareServer"></a>
	<h3 class="method-title"><code><a href="#//api/name/shareServer">&nbsp;&nbsp;shareServer</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p><a href="../Classes/OBServer.html">OBServer</a> object</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, weak, readonly) OBServer *shareServer</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/serverReachable" title="serverReachable"></a>
	<h3 class="method-title"><code><a href="#//api/name/serverReachable">&nbsp;&nbsp;serverReachable</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>State flag: Whether current <a href="#//api/name/network">network</a> status can reach <a href="#//api/name/server">server</a> or not</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) BOOL serverReachable</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/lanControllable" title="lanControllable"></a>
	<h3 class="method-title"><code><a href="#//api/name/lanControllable">&nbsp;&nbsp;lanControllable</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>State flag: Whether current <a href="#//api/name/network">network</a> allow LAN control or not</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) BOOL lanControllable</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/isServerMode" title="isServerMode"></a>
	<h3 class="method-title"><code><a href="#//api/name/isServerMode">&nbsp;&nbsp;isServerMode</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>State flag: Whether logged in and accessible with <a href="#//api/name/server">server</a> Or only LAN controllable</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) BOOL isServerMode</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/enableLanData" title="enableLanData"></a>
	<h3 class="method-title"><code><a href="#//api/name/enableLanData">&nbsp;&nbsp;enableLanData</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Advanced: Enable or Disable auto discover Lan OBox (Default Enable)</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) BOOL enableLanData</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>Default set to Yes for <a href="../Classes/OBNetwork.html">OBNetwork</a> discovery automatically, set No will stop auto discovery and remove all local data if have.</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/autoLoadLocalData" title="autoLoadLocalData"></a>
	<h3 class="method-title"><code><a href="#//api/name/autoLoadLocalData">&nbsp;&nbsp;autoLoadLocalData</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Advanced: Enable or Disable auto load OBox data when discovered (Default Enable)</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) BOOL autoLoadLocalData</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>Default set to Yes for load OBox data automatically after discovered, set No to load OBox object data manual.</p>
			</div>
			

			

			
			<div class="method-subsection see-also-section">
				<h4 class="method-subtitle">See Also</h4>
				<ul>
					
					<li><code><p><a href="#//api/name/loadLocalData:forBox:">- loadLocalData:forBox:</a></p></code></li>
					
				</ul>
			</div>
			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/loginUser:andPw:" title="loginUser:andPw:"></a>
	<h3 class="method-title"><code><a href="#//api/name/loginUser:andPw:">&ndash;&nbsp;loginUser:andPw:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>login <a href="#//api/name/server">server</a> using account</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)loginUser:(nonnull NSString *)<em>username</em> andPw:(nonnull NSString *)<em>password</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>username</code></th>
						<td><p>account username</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>password</code></th>
						<td><p>account password</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			
			<div class="method-subsection see-also-section">
				<h4 class="method-subtitle">See Also</h4>
				<ul>
					
					<li><code><p><a href="../Classes/OBServer.html#//api/name/signInUser:withPW:">[OBServer signInUser:withPW:]</a></p></code></li>
					
				</ul>
			</div>
			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/canLoginFromCache" title="canLoginFromCache"></a>
	<h3 class="method-title"><code><a href="#//api/name/canLoginFromCache">&ndash;&nbsp;canLoginFromCache</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Try login <a href="#//api/name/server">server</a> using last account token.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (BOOL)canLoginFromCache</code></div>

		    
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>whether exist last account token or not</p>
			</div>
			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>OBManager support login using token which saved in cache from last logged in account</p>
			</div>
			

			

			
			<div class="method-subsection see-also-section">
				<h4 class="method-subtitle">See Also</h4>
				<ul>
					
					<li><code><p><a href="../Classes/OBServer.html#//api/name/tryLoadLastAccount">[OBServer tryLoadLastAccount]</a></p></code></li>
					
				</ul>
			</div>
			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/currentUsername" title="currentUsername"></a>
	<h3 class="method-title"><code><a href="#//api/name/currentUsername">&nbsp;&nbsp;currentUsername</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Get username of current logged in account</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) NSString *currentUsername</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/currentWeight" title="currentWeight"></a>
	<h3 class="method-title"><code><a href="#//api/name/currentWeight">&nbsp;&nbsp;currentWeight</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Get right of current logged in account</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) OBMWeight currentWeight</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/logout" title="logout"></a>
	<h3 class="method-title"><code><a href="#//api/name/logout">&ndash;&nbsp;logout</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Logout account from <a href="#//api/name/server">server</a></p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)logout</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/loadEntityData:" title="loadEntityData:"></a>
	<h3 class="method-title"><code><a href="#//api/name/loadEntityData:">&ndash;&nbsp;loadEntityData:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Query type of data in <a href="#//api/name/server">server</a></p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)loadEntityData:(OBMType)<em>type</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>type</code></th>
						<td><p><a href="../Constants/OBMType.html">OBMType</a> enum</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>For <a href="#//api/name/server">server</a>, query specific type of data and cache updated data in <a href="#//api/name/model">model</a>.
eg. call this function using OBM_All after login <a href="#//api/name/server">server</a> successful</p>

<h2>Better call <code>+ctlRefresh...</code> in OBUIExtension to perform a data refresh process</h2><div class="warning"><p><strong>Warning:</strong> Not Clean Database. If need reload, do something before call this function</p></div>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/cacheDataSuccess" title="cacheDataSuccess"></a>
	<h3 class="method-title"><code><a href="#//api/name/cacheDataSuccess">&nbsp;&nbsp;cacheDataSuccess</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>State flag: Whether load data success from <a href="#//api/name/server">server</a> or is loading</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) BOOL cacheDataSuccess</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>Whenever you use <a href="#//api/name/loadEntityData:"><code>loadEntityData:</code></a> or the login request query data, the flag is set to No until the data is successfully loaded from the <a href="#//api/name/server">server</a>.</p>

<h2>Important flag answer to UI whether to reload data.</h2>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/deviceTypeCount" title="deviceTypeCount"></a>
	<h3 class="method-title"><code><a href="#//api/name/deviceTypeCount">&nbsp;&nbsp;deviceTypeCount</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Advanced: Counts for kinds of devices in <a href="#//api/name/server">server</a></p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) NSDictionary&lt;NSNumber*NSNumber*&gt; *deviceTypeCount</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>Return dictionary of counts for devices type (All intValue)</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/reloadDeviceTypeCount" title="reloadDeviceTypeCount"></a>
	<h3 class="method-title"><code><a href="#//api/name/reloadDeviceTypeCount">&ndash;&nbsp;reloadDeviceTypeCount</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Advanced: reload counts for kinds of devices in <a href="#//api/name/server">server</a></p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)reloadDeviceTypeCount</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>For <a href="#//api/name/server">server</a> refresh data, this function will make <a href="#//api/name/deviceTypeCount">deviceTypeCount</a> dictionary update, wait until <a href="#//api/name/deviceTypeCount">deviceTypeCount</a> response is not nil, call <a href="#//api/name/loadEntityData:">loadEntityData:</a> to reload data</p>

<h2>Better call +ctlRefresh&hellip; in OBUIExtension to perform a data refresh process</h2>
			</div>
			

			

			
			<div class="method-subsection see-also-section">
				<h4 class="method-subtitle">See Also</h4>
				<ul>
					
					<li><code><p><a href="#//api/name/deviceTypeCount">@property deviceTypeCount</a></p></code></li>
					
					<li><code><p><a href="#//api/name/loadLocalData:forBox:">- loadLocalData:forBox:</a></p></code></li>
					
				</ul>
			</div>
			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/compareModelDataUpdated" title="compareModelDataUpdated"></a>
	<h3 class="method-title"><code><a href="#//api/name/compareModelDataUpdated">&ndash;&nbsp;compareModelDataUpdated</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Advanced: Compare cacheData in <a href="#//api/name/model">model</a> whether is updated or not</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (BOOL)compareModelDataUpdated</code></div>

		    
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>Bool value of updated or not</p>
			</div>
			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>Messenger will auto cache database, this function return a bool value compare result of whether data is up-to-date or not.
If No, Call -loadEntityData:OBM_All after clean database.</p><div class="warning"><p><strong>Warning:</strong> Not Finish that always return No</p></div>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/loadLocalData:forBox:" title="loadLocalData:forBox:"></a>
	<h3 class="method-title"><code><a href="#//api/name/loadLocalData:forBox:">&ndash;&nbsp;loadLocalData:forBox:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>load local specific obox data (All, Device, Group or Scene).</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)loadLocalData:(OBMType)<em>type</em> forBox:(nonnull OBBox *)<em>box</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>type</code></th>
						<td><p>(OBM_All, OBM_Device, OBM_Group and OBM_Scene) for specific data</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>box</code></th>
						<td><p>target box</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>Default: Automatically load all obox data after discovered using OBM_All
Advanced: Better call +ctlRefresh&hellip; in OBUIExtension to perform a data refresh process</p>
			</div>
			

			

			
			<div class="method-subsection see-also-section">
				<h4 class="method-subtitle">See Also</h4>
				<ul>
					
					<li><code><p><a href="#//api/name/autoLoadLocalData">@property autoLoadLocalData</a></p></code></li>
					
				</ul>
			</div>
			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/localDataIsReadyFor:withType:" title="localDataIsReadyFor:withType:"></a>
	<h3 class="method-title"><code><a href="#//api/name/localDataIsReadyFor:withType:">&ndash;&nbsp;localDataIsReadyFor:withType:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>State flag: Whether local Obox data load and cache finish</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (BOOL)localDataIsReadyFor:(nonnull OBBox *)<em>box</em> withType:(OBMType)<em>type</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>box</code></th>
						<td><p>target box</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>type</code></th>
						<td><p>(OBM_All, OBM_Box, OBM_Device, OBM_Group and OBM_Scene) for specific data</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>Bool value of data ready or not</p>
			</div>
			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>For local, return a bool value about obox specific data is load ready or not.
Useful flag in a timer waiting local box data loading.
OBM_Box tell whether obox is accessable
OBM_All tell all obox data cache ready or not</p>
			</div>
			

			

			
			<div class="method-subsection see-also-section">
				<h4 class="method-subtitle">See Also</h4>
				<ul>
					
					<li><code><p><a href="#//api/name/loadLocalData:forBox:">- loadLocalData:forBox:</a></p></code></li>
					
				</ul>
			</div>
			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						
					</div>
					
					

                    
                    
          
				</main>

				<footer>
					<div class="footer-copyright">
						
						<p class="copyright">Copyright &copy; 2017 On-Bright. All rights reserved. Updated: 2017-06-09</p>
						
						
						<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
						
					</div>
				</footer>
			</div>
		</div>
	</article>

	<script src="../js/script.js"></script>
</body>
</html>